import request from '@/utils/request'

// 获取所有角色列表 /sys/role
export const getRolesListRequest = params => request.get('/sys/role', { params })

// 添加角色
export const addRolesListRequest = data => request.post('/sys/role', data)

// 根据ID更新角色
export const updateRolesRequestById = data => request.put(`/sys/role/${data.id}`, data)

// 根据ID删除角色
export const delRolesRequestById = id => request.delete(`/sys/role/${id}`)

// 给角色分配权限
export const assignPermissionRequest = data => request.put('/sys/role/assignPrem', data)

// 根据ID获取角色详情
export const getRoleDetailByIdRequest = id => request.get(`/sys/role/${id}`)

